/**
 * 
 */
package net.mikoo.seals.boss.biz.services.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.mikoo.seals.boss.biz.mapper.boss.PartyRoleMapper;
import net.mikoo.seals.boss.biz.services.PartyRoleServices;
import net.mikoo.seals.boss.common.BaseServices;
import net.mikoo.seals.boss.common.exception.ParametersException;
import net.mikoo.seals.boss.model.PartyRole;

/**
 * @author huangxm
 *
 */
@Service
public class PartyRoleServicesImpl extends BaseServices implements PartyRoleServices {
	
	Logger logger = Logger.getLogger(PartyRoleServicesImpl.class);
	
	@Autowired
	private PartyRoleMapper partyRoleMapper;
	
	@Override
	public List<PartyRole> selectByPartyId(Long partyId) {

		List<PartyRole> roles = partyRoleMapper.selectByPartyId(partyId);
		return roles;
	}

	@Override
	public List<PartyRole> selectAll() {

		List<PartyRole> roles = partyRoleMapper.selectAll();
		return roles;
	}

	@Override
	public void deleteByPartyId(Long partyId) {
		// 打印执行日志

		if (partyId == null) {
			throw new ParametersException("partyId is null!");
		}
		// 打印执行参数日志
		partyRoleMapper.deleteByPartyId(partyId);

	}

}
